package org.nicocube.airain.common.client.form;

import java.util.Date;

import com.google.gwt.i18n.client.Constants;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.datepicker.client.DateBox;
import com.google.gwt.user.datepicker.client.DatePicker;
import com.google.gwt.user.datepicker.client.DateBox.DefaultFormat;

public abstract class DateField extends FormField<Date> {

	public DateField(String name, Form form, Constants constants) {
		super(name, form, constants);
	}

	@Override
	protected HasValue<Date> constructWidget(Constants constants) {
		return new DateBox(new DatePicker(),getInForm(),new DefaultFormat(DateTimeFormat.getFormat("yyyy/MM/dd")));
	}

}
